#include<iostream>
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<sys/types.h>
#include<3DSReader.h>
#include<time.h>
using namespace std;

void print_usag(char * common)
{
	printf("usag:%s model.3ds\n",common);
}
int main(int argc,char *argv[])
{
	dsloader loader;
	if(argc<2) //usag error
	{
		print_usag(argv[0]);
		return 0;
	}
	if(!loader.load(argv[1])) //load failure
	{
		printf("load %s error\n",argv[1]);
		return 0;
	}
	// load success
	list<chunkData*> chunk=loader.getListChunk();
	list<chunkData*>::iterator iter;
	for(iter=chunk.begin();iter!=chunk.end();++iter)
	{
		printf("name is %s ,vertex number=%d ,triangle face number=%d\n",(*iter)->get_name(),(*iter)->get_vertex_length(),(*iter)->get_face_length());
	}
	return int(0);
}
